Optimal. Leaf size=53 \[ 2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x+2 \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a}}{\sqrt {-\frac {a}{x^2}+\frac {b}{x}} x}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2004, 2032,
2038, 634, 209} \begin {gather*} 2 \sqrt {a} \text {ArcTan}\left (\frac {\sqrt {a}}{x \sqrt {\frac {b}{x}-\frac {a}{x^2}}}\right )+2 x \sqrt {\frac {b}{x}-\frac {a}{x^2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 634
Rule 2004
Rule 2032
Rule 2038
Rubi steps
\begin {align*} \int \sqrt {\frac {-a+b x}{x^2}} \, dx &=\int \sqrt {-\frac {a}{x^2}+\frac {b}{x}} \, dx\\ &=2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x-a \int \frac {1}{\sqrt {-\frac {a}{x^2}+\frac {b}{x}} x^2} \, dx\\ &=2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x+a \text {Subst}\left (\int \frac {1}{\sqrt {b x-a x^2}} \, dx,x,\frac {1}{x}\right )\\ &=2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x+(2 a) \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,\frac {1}{\sqrt {-\frac {a}{x^2}+\frac {b}{x}} x}\right )\\ &=2 \sqrt {-\frac {a}{x^2}+\frac {b}{x}} x+2 \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a}}{\sqrt {-\frac {a}{x^2}+\frac {b}{x}} x}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 66, normalized size = 1.25 \begin {gather*} \frac {2 x \sqrt {\frac {-a+b x}{x^2}} \left (\sqrt {-a+b x}-\sqrt {a} \tan ^{-1}\left (\frac {\sqrt {-a+b x}}{\sqrt {a}}\right )\right )}{\sqrt {-a+b x}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 55, normalized size = 1.04
method | result | size |
default | \(\frac {2 \sqrt {-\frac {-b x +a}{x^{2}}}\, x \left (-\sqrt {a}\, \arctan \left (\frac {\sqrt {b x -a}}{\sqrt {a}}\right )+\sqrt {b x -a}\right )}{\sqrt {b x -a}}\) | \(55\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.33, size = 98, normalized size = 1.85 \begin {gather*} \left [2 \, x \sqrt {\frac {b x - a}{x^{2}}} + \sqrt {-a} \log \left (\frac {b x - 2 \, \sqrt {-a} x \sqrt {\frac {b x - a}{x^{2}}} - 2 \, a}{x}\right ), 2 \, x \sqrt {\frac {b x - a}{x^{2}}} - 2 \, \sqrt {a} \arctan \left (\frac {x \sqrt {\frac {b x - a}{x^{2}}}}{\sqrt {a}}\right )\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {\frac {- a + b x}{x^{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 61, normalized size = 1.15 \begin {gather*} -2 \, \sqrt {a} \arctan \left (\frac {\sqrt {b x - a}}{\sqrt {a}}\right ) \mathrm {sgn}\left (x\right ) + 2 \, {\left (\sqrt {a} \arctan \left (\frac {\sqrt {-a}}{\sqrt {a}}\right ) - \sqrt {-a}\right )} \mathrm {sgn}\left (x\right ) + 2 \, \sqrt {b x - a} \mathrm {sgn}\left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.18, size = 67, normalized size = 1.26 \begin {gather*} 2\,x\,\sqrt {\frac {b}{x}-\frac {a}{x^2}}+\frac {2\,\sqrt {a}\,\sqrt {x}\,\mathrm {asin}\left (\frac {\sqrt {a}}{\sqrt {b}\,\sqrt {x}}\right )\,\sqrt {\frac {b}{x}-\frac {a}{x^2}}}{\sqrt {b}\,\sqrt {1-\frac {a}{b\,x}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________